<template>
  <div class="operation">
    <van-cell class="content">
      <div class="flex-between line-height-3">
        <div class="col-333333 font-bold-500 font-15 m-r-10">{{ objContent.name }}</div>
      </div>
      <div class="flex-between font-12 line-height-3">
        <div class="col-666666 m-r-10 line-text-out">发布部门：{{ objContent.releaseUnit }}</div>
      </div>

      <div class="flex-between font-12 line-height-3">
        <div class="col-666666 m-r-10 line-text-out">
          发布日期：{{ objContent.releaseDate | dateFormat('YYYY-MM-DD') }}
        </div>
        <div class="col-666666 m-r-10 line-text-out">
          实施日期：{{ objContent.implementDate | dateFormat('YYYY-MM-DD') }}
        </div>
      </div>
      <div class="flex-between line-height-3" style="margin-top: 5px">
        <div class="col-333333 font-bold-400 font-14 m-r-10">标准摘要</div>
      </div>
      <div class="col-333333 font-bold-400 font-14" v-html="objContent.standardAbstract"></div>
    </van-cell>

    <van-cell class="content m-t-10" v-if="objContent.uploadFileArray">
      <div class="flex-between line-height-3">
        <div class="col-333333 font-bold-500 font-15 m-r-10">附件 </div>
      </div>
      <div class="flex-between font-12 line-height-3" v-for="(item, key) in objContent.uploadFileArray" :key="key">
        <div class="col-666666 m-r-10 line-text-out">{{ item.name }}</div>
        <div class="allowgetattach">
          <!-- <button @click="goCheckFj(item)">查看附件</button> -->
          <button @click="goDownloadFj(item)">下载附件</button>
        </div>
      </div>
    </van-cell>
    <van-cell class="content m-t-10" v-else>
      <div class="flex-between line-height-3">
        <div class="col-333333 font-bold-500 font-15 m-r-10">附件</div>
      </div>
      <div class="flex-between font-12 line-height-3">
        <div class="col-666666 m-r-10 line-text-out">暂无附件</div>
      </div>
    </van-cell>
  </div>
</template>
<script>
import { Swipe, SwipeItem, Cell, SidebarItem } from 'vant'
import dayjs from 'dayjs'
import { getValue } from '../../utils/auth'
import { getHandle, postHandle } from '@/api'

export default {
  name: 'jobPlacement',
  components: {
    [Swipe.name]: Swipe,
    [SwipeItem.name]: SwipeItem,
    [Cell.name]: Cell
  },
  data() {
    return {
      current: 0,
      Id: getValue('evaluationDetails-view-id'),

      bannerList: [],
      objContent: {}
    }
  },
  created() {
    this.initialize()
  },
  mounted() {},
  methods: {
    initialize() {
      getHandle(`/agri/api/sshfw/evaluationStandards/queryDetail/${this.Id}`).then(res => {
        this.objContent = res.data
      })
    },
    onChange(index) {
      this.current = index
    },
    goCheckFj(item) {
      this.$bridge.call('lookFile', item.fileId)
    },
    goDownloadFj(item) {
      this.$bridge.call('downloadFille', item.fileId)
    }
  }
}
</script>
<style lang="scss" scoped>
.allowgetattach {
  > button {
    width: 68px;
    height: 24px;
    border-radius: 2px;
    border: 1px solid #37b5b5;
    background-color: #fff;
    font-size: 13px;
    font-weight: 400;
    color: #37b5b5;
    line-height: 24px;
    margin-left: 10px;
  }
}
.pStyle {
  font-size: 12px;
  font-weight: 400;
  color: #ff0000;
  margin-left: 15px;
}
.m-t-10 {
  margin-top: 10px !important;
}
.content {
  padding: 10px;
}
.custom-indicator {
  position: absolute;
  right: 5px;
  bottom: 5px;
  padding: 2px 5px;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.1);
}
</style>
